<div class="m-tab s-tab">
	<h2 class="u-tt">文章栏目</h2>
	<ul class="u-tabs">
		<li><a href="{$url|'AdminCategory/index'}">栏目列表</a></li>
		<li><a href="#tab1" class="tab-on tab-a">{$actionName}文章栏目</a></li>
		<li><a href="#tab2" class="tab-a">其他设置</a></li>
		<li><a href="#tab3" class="tab-a">上传设置</a></li>
	</ul>
</div>
<div class="m-form">
	<form name="" action="<?php echo url('AdminCategory/'.$action.'Data'); ?>" method="post" id="form">
		<fieldset>
			<div id="tab1">
				<div class="formitm">
					<label class="lab">上级栏目：</label>
					<div class="ipt">
						<select class="u-slt" name="parent_id" id="parent_id"  datatype="*">
							<option value="0">=====顶级栏目=====</option>
							<!--{loop="$categoryList $vo"}--> 
							<option <!--{if="$vo['class_id']==$info['parent_id']"}-->selected="selected"<!--{/if}--> value="{$vo.class_id}">{$vo.cname}
							
							</option>
							<!--{/loop}-->
						</select>
						<?php if($info){ ?>
						<label class="u-opt"><input name="upmenu" type="checkbox" value="1" />
							更新菜单关系 </label>
						<?php } ?>
						<p></p>
					</div>
				</div>
				<?php if(!$info){ ?>
				<div class="formitm">
					<label class="lab">栏目名称：</label>
					<div class="ipt">
						<textarea name="namelist" class="u-tta u-tta-6"  datatype="*" errormsg="栏目名称不能为空！" ></textarea>
						<p>批量添加一行一个栏，每行格式为名称|URL名称</p>
					</div>
				</div>
				<?php }else{ ?>
				<div class="formitm">
					<label class="lab">栏目名称：</label>
					<div class="ipt">
						<input name="name" type="text" class="u-ipt u-ipt-6" id="name" value="{$info.name}" datatype="*" errormsg="栏目名称至少1~20个字符！" />
						<p></p>
					</div>
				</div>
				<div class="formitm">
					<label class="lab" >栏目URL：</label>
					<div class="ipt">
						<input name="urlname" type="text" class="u-ipt u-ipt-6" value="{$info.urlname}" />
						<p>栏目URL名称，不能含有特殊符号</p>
					</div>
				</div>
				<div class="formitm">
					<label class="lab">栏目形象图：</label>
					<div class="ipt">
						<input type="text" name="image"  class="u-ipt u-ipt-4" id="image" value="{$info.image}"  />
						<span class="suffix">
						<button class="u-btn u-img-upload" type="button" data="image" preview="image_preview" id="image_button">上传</button>
						<button class="u-btn" type="button" id="image_preview">预览</button>
						</span> </div>
				</div>
				<?php } ?>
				<div class="formitm">
					<label class="lab">栏目属性：</label>
					<div class="ipt">
						<?php if(!isset($info['type'])){ $info['type']=1; } ?>
						<label class="u-opt">
							<input name="type" type="radio" value="0" {if="$info['type']==0"} checked="checked" {/if} />
							频道</label>
						<label class="u-opt">
							<input name="type" type="radio" value="1" {if="$info['type']==1"} checked="checked" {/if} />
							列表</label>
						<p>频道页不能发布</p>
					</div>
				</div>
				
				<div class="formitm">
					<label class="lab">分页数：</label>
					<div class="ipt">
						<input name="page" type="text" class="u-ipt u-ipt-2" value="10" datatype="n" errormsg="分页数填写错误！"  />
						<span class="suffix">条每页</span>
						<p></p>
					</div>
				</div>
				<div class="formitm">
					<label class="lab">栏目顺序：</label>
					<div class="ipt">
						<input name="sequence" type="text" class="u-ipt u-ipt-2" value="{$info.sequence|is_empty:1}" />
						<p>数字越小栏目越靠前</p>
					</div>
				</div>
				<div class="formitm">
					<label class="lab">列表页排序：</label>
					<div class="ipt">
						<select name="content_order" class="u-slt">
							<option  {if="$info['content_order']=='time DESC'"} selected="selected" {/if} value="time DESC">发布时间 新-旧 </option>
							<option  {if="$info['content_order']=='time ASC'"} selected="selected" {/if} value="time ASC">发布时间 旧-新 </option>
							<option  {if="$info['content_order']=='sequence DESC'"} selected="selected" {/if} value="sequence DESC">自定义排序 大-小 </option>
							<option  {if="$info['content_order']=='sequence ASC'"} selected="selected" {/if} value="sequence ASC">自定义排序 小-大 </option>
						</select>
						<p>栏目下的排序方式</p>
					</div>
				</div>
				<div class="formitm">
					<label class="lab">栏目模板：</label>
					<div class="ipt">
						<input name="class_tpl" type="text" class="u-ipt u-ipt-4" id="class_tpl" value="{$info.class_tpl|is_empty:'list.html'}" datatype="*"   />
						<p>当前栏目所使用的模板</p>
					</div>
				</div>
				<div class="formitm">
					<label class="lab">文章模板：</label>
					<div class="ipt">
						<input name="content_tpl" type="text" class="u-ipt u-ipt-4" id="content_tpl" value="{$info.content_tpl|is_empty:'content.html'}"  datatype="*" />
						<p>当前栏目下所使用的模板</p>
					</div>
				</div>
			</div>
			<div id="tab2" class="m-tabpanel">
				<div class="formitm">
					<label class="lab">绑定字段集：</label>
					<div class="ipt">
						<select name="fieldset_id" class="u-slt" id="fieldset_id">
							<option value="0">==不绑定==</option>
							<!--{loop="$FieldsetList $vo"}--> 
							<option value="{$vo.fieldset_id}" {if="$info['fieldset_id']==$vo['fieldset_id']"} selected="selected" {/if} >
							{$vo.name}
							</option>
							<!--{/loop}-->
						</select>
						<p>用来扩展内容字段</p>
					</div>
				</div>
				<div class="formitm">
					<label class="lab" >关键词：</label>
					<div class="ipt">
						<input name="keywords" type="text" class="u-ipt u-ipt-6" id="keywords" value="{$info.keywords}" maxlength="250" />
						<label class="u-opt">
					</div>
				</div>
				<div class="formitm">
					<label class="lab" >描述：</label>
					<div class="ipt">
						<textarea name="description" id="description" class="u-tta u-tta-6" >{$info.description}</textarea>
					</div>
				</div>
			</div>
			<div id="tab3" class="m-tabpanel">
				<div class="formitm">
					<label class="lab" >缩图方式：</label>
					<div class="ipt"> {if="!isset($configUpload['THUMBNAIL_TYPE_INHERIT'])"}{$configUpload.THUMBNAIL_TYPE_INHERIT=1}{/if}
						<label class="u-opt">
							<input name="config_upload[THUMBNAIL_TYPE_INHERIT]" {if="$configUpload['THUMBNAIL_TYPE_INHERIT']"} checked="checked" {/if} type="checkbox" value="1" />
							继承</label>
						<label class="u-opt">
							<input type="radio" name="config_upload[THUMBNAIL_TYPE]" value="1" {if="$configUpload['THUMBNAIL_TYPE']"} checked="checked" {/if} />
							裁剪</label>
						<label class="u-opt">
							<input type="radio" name="config_upload[THUMBNAIL_TYPE]" value="0" {if="!$configUpload['THUMBNAIL_TYPE']"} checked="checked" {/if} />
							按比例</label>
					</div>
				</div>
				<div class="formitm">
					<label class="lab" >缩图开关：</label>
					<div class="ipt"> {if="!isset($configUpload['THUMBNAIL_ON_INHERIT'])"}{$configUpload.THUMBNAIL_ON_INHERIT=1}{/if}
						<label class="u-opt">
							<input name="config_upload[THUMBNAIL_ON_INHERIT]" {if="$configUpload['THUMBNAIL_ON_INHERIT']"} checked="checked" {/if}  type="checkbox" value="1" />
							继承</label>
						<label class="u-opt">
							<input type="radio" name="config_upload[THUMBNAIL_ON]" {if="$configUpload['THUMBNAIL_ON']"} checked="checked" {/if} value="1" checked="checked" />
							开启</label>
						<label class="u-opt">
							<input type="radio" name="config_upload[THUMBNAIL_ON]" {if="!$configUpload['THUMBNAIL_ON']"} checked="checked" {/if} value="0" />
							关闭</label>
					</div>
				</div>
				<div class="formitm">
					<label class="lab" >缩图尺寸：</label>
					<div class="ipt"> {if="!isset($configUpload['THUMBNAIL_SIZE_INHERIT'])"}{$configUpload.THUMBNAIL_SIZE_INHERIT=1}{/if}
						<label class="u-opt">
							<input name="config_upload[THUMBNAIL_SIZE_INHERIT]" {if="$configUpload['THUMBNAIL_SIZE_INHERIT']"} checked="checked" {/if}  type="checkbox" value="1" />
							继承</label>
						<label class="u-opt">宽度：</label>
						<input name="config_upload[THUMBNAIL_WIDTH]" type="text" class="u-ipt u-ipt-1" value="{$config_upload.THUMBNAIL_WIDTH|is_empty:'500'}" />
						px
						<label class="u-opt">高度：</label>
						<input name="config_upload[THUMBNAIL_HEIGHT]" type="text" class="u-ipt u-ipt-1" value="{$config_upload.THUMBNAIL_HEIGHT|is_empty:'500'}" />
						px </div>
				</div>
				<div class="formitm">
					<label class="lab" >水印开关：</label>
					<div class="ipt"> {if="!isset($configUpload['WATERMARK_ON_INHERIT'])"}{$configUpload.WATERMARK_ON_INHERIT=1}{/if}
						<label class="u-opt">
							<input name="config_upload[WATERMARK_ON_INHERIT]" {if="$configUpload['WATERMARK_ON_INHERIT']"} checked="checked" {/if}  type="checkbox" value="1" />
							继承</label>
						<label class="u-opt">
							<input type="radio" name="config_upload[WATERMARK_ON]" value="1" {if="$configUpload['WATERMARK_ON']"} checked="checked" {/if}  />
							开启</label>
						<label class="u-opt">
							<input type="radio" name="config_upload[WATERMARK_ON]" value="0" {if="!$configUpload['WATERMARK_ON']"} checked="checked" {/if} />
							关闭</label>
					</div>
				</div>
				<div class="formitm">
					<label class="lab" >水印位置：</label>
					<div class="ipt"> {if="!isset($configUpload['WATERMARK_POSITION_INHERIT'])"}{$configUpload.WATERMARK_POSITION_INHERIT=1}{/if}
						<label class="u-opt">
							<input name="config_upload[WATERMARK_POSITION_INHERIT]" {if="$configUpload['WATERMARK_POSITION_INHERIT']"} checked="checked" {/if}  type="checkbox" value="1" />
							继承</label>
						<select name="config_upload[WATERMARK_POSITION]" class="u-slt">
							<option value="0" {if="$configUpload['WATERMARK_POSITION']==0"} selected="selected" {/if} >随机</option>
							<option value="1" {if="$configUpload['WATERMARK_POSITION']==1"} selected="selected" {/if} >左上</option>
							<option value="2" {if="$configUpload['WATERMARK_POSITION']==2"} selected="selected" {/if} >中上</option>
							<option value="3" {if="$configUpload['WATERMARK_POSITION']==3"} selected="selected" {/if} >右上</option>
							<option value="4" {if="$configUpload['WATERMARK_POSITION']==4"} selected="selected" {/if} >左中</option>
							<option value="5" {if="$configUpload['WATERMARK_POSITION']==5"} selected="selected" {/if} >正中</option>
							<option value="6" {if="$configUpload['WATERMARK_POSITION']==6"} selected="selected" {/if} >右中</option>
							<option value="7" {if="$configUpload['WATERMARK_POSITION']==7"} selected="selected" {/if} >左下</option>
							<option value="8" {if="$configUpload['WATERMARK_POSITION']==8"} selected="selected" {/if} >中下</option>
							<option value="9" {if="$configUpload['WATERMARK_POSITION']==9"} selected="selected" {/if} >右下</option>
						</select>
					</div>
				</div>
				<div class="formitm">
					<label class="lab" >水印图片：</label>
					<div class="ipt"> {if="!isset($configUpload['WATERMARK_IMAGE_INHERIT'])"}{$configUpload.WATERMARK_IMAGE_INHERIT=1}{/if}
						<label class="u-opt">
							<input name="config_upload[WATERMARK_IMAGE_INHERIT]" {if="$configUpload['WATERMARK_IMAGE_INHERIT']"} checked="checked" {/if}  type="checkbox" value="1" />
							继承</label>
						<input name="config_upload[WATERMARK_IMAGE]" type="text" class="u-ipt u-ipt-6" value="{$config_upload.WATERMARK_IMAGE|is_empty:'logo.png'}" />
						<p>位于public/watermark下的图片文件</p>
					</div>
				</div>
				<div class="formitm">
					<label class="lab" >上传格式：</label>
					<div class="ipt"> {if="!isset($configUpload['UPLOAD_TYPE_INHERIT'])"}{$configUpload.UPLOAD_TYPE_INHERIT=1}{/if}
						<label class="u-opt">
							<input name="config_upload[UPLOAD_TYPE_INHERIT]" {if="$configUpload['UPLOAD_TYPE_INHERIT']"} checked="checked" {/if}  type="checkbox" value="1" />
							继承</label>
						<input name="config_upload[UPLOAD_TYPE]" type="text" class="u-ipt u-ipt-6" value="{$config_upload.UPLOAD_TYPE|is_empty:'jpg,gif,png,bmp'}" />
						<p>系统会自动过滤危险文件</p>
					</div>
				</div>
				<div class="formitm">
					<label class="lab" >上传大小：</label>
					<div class="ipt"> {if="!isset($configUpload['UPLOAD_SIZE_INHERIT'])"}{$configUpload.UPLOAD_SIZE_INHERIT=1}{/if}
						<label class="u-opt">
							<input name="config_upload[UPLOAD_SIZE_INHERIT]" {if="$configUpload['UPLOAD_SIZE_INHERIT']"} checked="checked" {/if}  type="checkbox" value="1" />
							继承</label>
						<input name="config_upload[UPLOAD_SIZE]" type="text" class="u-ipt  u-ipt-1" value="{$config_upload.UPLOAD_SIZE|is_empty:3}" />
						<span class="suffix">M</span>
						<p>程序限制上传大小，服务器限制请自行调整</p>
					</div>
				</div>
			</div>
			<div class="formitm formitm-1  formitm-2">
				<input name="class_id" type="hidden" value="{$info.class_id}" />
				<button class="u-btn" type="submit">保存</button>
				<button class="u-btn s-btn-c3" type="reset">重置</button>
				<span class="status" id="status"></span> </div>
		</fieldset>
	</form>
</div>
<script>
Do.ready('base','form','dialog','color','editor','sort','upload','tabs',function() {
	//表单综合处理
	$('#form').duxFormPage({returnUrl:'{$url|"AdminCategory/index"}'});
});
</script>